function queryUlposCouponByComplexCondition(){
    // 设定url
	var bankid = $("#bankInput").val();
	var clsid = $('#dictInput').val();
	var areaName = $('#countyInput').val();
	var areaId = $('#countyIdInput').val();
	var page = $("#currentPageInput").val();
    var requestUrl = "ulPosAction!queryUlposCouponByComplexCondition.action?bankid=" + bankid + "&clsid=" + clsid + "&areaName=" + areaName + "&page=" + page + "&areaId=" + areaId;
    requestUrl = encodeURI(requestUrl,"utf-8");// 将请求encode处理中文乱码
    $.ajax({ 
		  type:"POST",
		  contentType:"application/x-www-form-urlencoded; charset=UTF-8",
		  url:requestUrl,
		  dataType:"text",
		  cache:false,
		  success:function(mes){
		    var jsonObj=eval("("+mes+")");// 将json类型的字符串转化成json对像
		    var ulposCouponJSONArray = jsonObj.ulposCouponJSONArray;// 通过json数据的键取值
		    var ulposCouponList = eval(ulposCouponJSONArray);
		    var splitPageJsonArray = jsonObj.splitPageJsonArray;
		    var splitPageJsonArrayStr = splitPageJsonArray.toString();
		    var splitPageParameter = splitPageJsonArrayStr.split(",");
		    var page = splitPageParameter[0];// 当前页
		    var pagetotal = splitPageParameter[1];// 分页总数
		    
		    var div = "<table width = '100%' cellspacing='0'>";
		    var rows = 0;
		    var length = ulposCouponList.length;
		    $("#couponsNumInput").val(length);// 加入缓存
		    var couponsContent = [];// js定义数组
		    for(var i = 0; i < length; i ++){
		    	var unionShop = ulposCouponList[i];
		    	var effectDate = unionShop.effect;
		    	var expiredDate = unionShop.expired;
		    	var finalEffectDate = effectDate.substring(0,10);
		    	var finalExpiredDate = expiredDate.substring(0,10);
		    	var content = "<strong>"+ unionShop.shopname +"&nbsp;:优惠<><br>"+
	                           unionShop.couname+"<br>"+
	                           "<span><strong>有效期：<>"+
	                           finalEffectDate + "至" + finalExpiredDate + "</span>";
		    	if(rows == 0){
		    	   div = div + "<tr style='border: 0px'>"
		    	}
		    	div = div + "<td><div class='Coupon'id='couponDiv'"+i+">" +
		    			    "<div class='CouOpen'>" +
		    			    "<div class='CloseInfo'></div>"+
		    			    "<div class='CouInfo'>" +
		    			    "<table width=100%><tr><td><span><strong>优惠<></tr>" +
		    			    unionShop.couname + "<br>" +
		    			    "<strong>有效期:<>" +
		    			     finalEffectDate + "至" + finalExpiredDate + "<br>" +
		    			    "<strong>参与门店:<>" +
		    			    "<a>" +unionShop.coubranchs+"家门店参与此活动</a></span></td></tr></table>" +
		    			    "</div>" +
		    			    "</div>" +
		    			    "<div class='CouPic'>" +
		    			    "<a><img width='218px' name='"+ unionShop.couid +"' height='170px' id='unionShopToAddCoupons"+ i +"' src='"+unionShop.pic+"'></a>" +
		    			    "</div>" +
		    			    "<div class='CouShop'>" +
		    			    "<div class='ShopLogo'>" +
		    			    "<a href='ulPosAction!toUlPosCouponShGoodsShow.action?shopid="+unionShop.shopid+"'><img width='50px' height='50px' src="+unionShop.logo+"></a>" +
		    			    "</div>" +
		    			    "<div class='ShopName'>" +
		    			    "<a class='a1' href='ulPosAction!toUlPosCouponShGoodsShow.action?shopid="+unionShop.shopid+"'>"+ unionShop.shopname +"</a>" +
		    			    "</div>" +
		    			    "</div>" +
		    			    "<div class='CouInfo'></div>" +
		    			    "<div class='CouBtn'><a href='#' id='unionShopToAddCoupons"+i+"' name='"+ unionShop.couid +"'>放入银联卡</a></div>" +
		    			    "</div>"+
		    			    "<input type='hidden' id='couponsContentInput"+i+"' value='"+content+"'/>";
		    			     var res = $("#coupon").html();
		    			     res = res.replaceAll("\"","'");
		    			     div = div + res;
		    			     div = div + "</td>";
		    	    rows = (i + 1) % 4;
		    	    if(rows == 0){
		    	        div = div + "</tr>";
		    	    }
		    	    
		    }
		    div = div + "</table><div class='pagelist'><ul id='splitPageUl'></ul></div>";
		    $("#unionShopDiv").hide();
		    $("#couponsDiv").show();
		    $("#couponsDiv").html(div);
		    $.splitPage(pagetotal,"splitPageUl");// 分页
	      }
	});

}
